package com.xnyzc.lhy.finance.service.fegin.invoice;

import com.xnyzc.lhy.finance.service.fegin.invoice.fallback.InvoiceServiceImpl;
import com.xnyzc.lhy.resource.entity.invoice.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * <p>
 * 电子发票服务
 * </p>
 *
 * @author haoyfa
 * @since 2019-10-24
 */
@FeignClient(name = "${feign.applicationName.resource}", fallback = InvoiceServiceImpl.class)
public interface IInvoiceService {
    /**
     * 发票开具
     */
    @PostMapping("/invoice/invoiceOpenRequest")
    public InvoiceOpenResult invoiceOpenRequest(@RequestBody InvoiceParam invoiceParam);

    /**
     * 板式文件生成
     */
    @PostMapping("/invoice/formatfileBuildRequest")
    public InvoiceFormatFileResult formatfileBuildRequest(@RequestBody InvoiceFormatFileParam invoiceFormatFileParam);

    /**
     * 发票作废
     * @param invoiceInvalidParam
     * @return
     */
    @PostMapping("/invoice/invoiceInvalidRequest")
    public ReInvoiceInvalidResult invoiceInvalidRequest(@RequestBody InvoiceInvalidParam invoiceInvalidParam);

    /**
     * AA发票开具
     * @param invoiceAaOpenParam
     * @return
     */
    @PostMapping("/invoiceAa/invoiceAaOpenRequest")
    InvoiceAaOpenResult invoiceAaOpenRequest(@RequestBody InvoiceAaOpenParam invoiceAaOpenParam);

    /**
     * AA发票查询
     * @param invoiceAaQueryOrCancellationParam
     * @return
     */
    @PostMapping("/invoiceAa/getInvoiceAaQuery")
    InvoiceAaOpenResult getInvoiceAaQuery(@RequestBody InvoiceAaQueryOrCancellationParam invoiceAaQueryOrCancellationParam);

    /**
     * AA发票作废
     * @param invoiceAaQueryOrCancellationParam
     * @return
     */
    @PostMapping("/invoiceAa/invoiceAaCancellation")
    InvoiceAaOpenResult invoiceAaCancellation(@RequestBody InvoiceAaQueryOrCancellationParam invoiceAaQueryOrCancellationParam);
}
